package com.sc.nft.entity.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.sc.nft.enums.PictureChartEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
@Data
public class PropTransferDetailsVO {
    @ApiModelProperty(value = "藏品名称")
    private String firstTitle;

    @ApiModelProperty(value = "缩略图")
    private String creationContent;

    @ApiModelProperty(value = "支付总数是多少.")
    private String paymentSum;

    @ApiModelProperty(value = "消耗类型 1.星球碎片 2.余额 3.燃料")
    private Integer consumeType;

    @ApiModelProperty(value = "赠送数量")
    private String quantityConsume;

    @ApiModelProperty(value = "赠送人名字")
    private String giftNickName;

    @ApiModelProperty(value = "接收人id")
    private String receiveNickName;

    @ApiModelProperty("创建时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ApiModelProperty(value = "使用的资源图片,比如他转赠的时候用的是钱 那么就给的是余额的图片")
    private String img;

    @ApiModelProperty(value = "描述-用来描述使用的资源文字")
    private String describe;

    public void setPaymentSum(BigDecimal paymentSum) {
        this.paymentSum = paymentSum.setScale(2,BigDecimal.ROUND_DOWN).toEngineeringString();
    }
    public void imgDecide() {
        if (this.consumeType == 1) {
            this.img = PictureChartEnum.PLANETARY_DEBRIS.getImg();
            this.describe=PictureChartEnum.PLANETARY_DEBRIS.getName();
        } else if (this.consumeType == 2) {
            this.img = PictureChartEnum.BALANCE.getImg();
            this.describe=PictureChartEnum.BALANCE.getName();
        } else {
            this.img = PictureChartEnum.BUNKERS.getImg();
            this.describe=PictureChartEnum.BUNKERS.getName();
        }
    }
}
